﻿function numboxPaste() {
    clipboardData.setData('text', clipboardData.getData('text').replace(/[^\d]/g, ''));
}
function isInt() {
    if ((event.keyCode >= 48) && (event.keyCode <= 57)) {
        event.returnValue = true;
    }
    else {
        event.returnValue = false;
    }
}
function isDecimal() {
    if ((event.keyCode >= 48) && (event.keyCode <= 57) || (event.keyCode == 46)) {
        event.returnValue = true;
    }
    else {
        event.returnValue = false;
    }
}
function checkAll(spanChk, chkName) {
    var elm = document.getElementsByName(chkName);
    if (elm != null) {
        for (i = 0; i < elm.length; i++)
            elm[i].checked = spanChk.checked;
    }
}
function getNoSelectionAlert(chkName, alertMsg) {
    var elm = document.getElementsByName(chkName);
    if (elm != null) {
        for (i = 0; i < elm.length; i++) {
            if (elm[i].checked) {
                return true;
            }
        }
    }
    alert(alertMsg);
    return false;
}
function setGridView(id) {
    var tab = document.getElementById(id);
    if (tab != null) {
        for (var i = 1; i < tab.rows.length - 1; i++) {//去掉表头和分页的行
            if (tab.rows[i].rowIndex % 2 == 0) {
                tab.rows[i].className = "a1";
                tab.rows[i].onmouseout = function () { this.className = "a1"; }
            }
            else {
                tab.rows[i].onmouseout = function () { this.className = ""; }
            }
            tab.rows[i].onmouseover = function () { this.className = "a2"; }
        }
    }
}
